package demo2;

import javax.crypto.spec.PSource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-15
 * Time: 17:12
 */
class Animal{
    public String name;
    public int age;
    public Animal(){
        System.out.println("不带参数的构造方法Animal");
    }

}
class Dog extends Animal{
    public Dog(String name){
        this.name  =name;
        System.out.println("带参数的构造方法Dog");
    }
    public void back(){
        System.out.println(this.name + "正在叫");
    }
}

public class Test1 {
    public static void main(String[] args) {
        Dog dog = new Dog("xiaobiesan");
        dog.back();

    }
}
